﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Ext.Net;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace IDM.Sandbox
{
    public partial class _Default : Sio.Mdm.Web.Controls.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Navigation.Urls.Add("Test.aspx");
            
        }

        [DirectMethod]
        public bool Direct(string data)
        {
            JObject obj = JsonConvert.DeserializeObject(data) as JObject;
            Ext.Net.ParameterCollection collection = new Ext.Net.ParameterCollection();

            foreach (KeyValuePair<string, JToken> token in obj)
            {
                collection.Add(new Ext.Net.Parameter(token.Key, token.Value.ToString()));
            }
            collection.ToJson();

            return false;
        }
    }
}
